using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using GonzalesCore.CoreElements;
using Jamila2.Database;
using Jamila2.Tools;

public class PrivateLoginSession : PersonalSessionAccount
{
    public string LanguageInUse
    {
        get
        {
            return (this.CurrentLoggedOnUser != null) ? this.CurrentLoggedOnUser.PreferedLanguage.InternalID : "en";
        }
    }

    public TypeOfDateFormat DateFormatInUse
    {
        get
        {
            return (this.CurrentLoggedOnUser != null) ? this.CurrentLoggedOnUser.PreferedDateFormat : TypeOfDateFormat.MMDDYYYY;
        }
    }

    public bool ShadowMode
    {
        get
        {
            return this.shadow_mode;
        }
    }

    public SystemUser ShadowUser
    {
        get
        {
            return this.shadow_user;
        }
    }

    public SystemUser ActualLoginUser
    {
        get
        {
            return (this.ShadowMode) ? this.ShadowUser : this.CurrentLoggedOnUser;
        }
    }

    // get from Active Directory during login
    public SystemUser DirectManagerUponLogin = null; 
    public string EmailUponLogin = ""; 
    public string DisplayNameUponLogin = "";
    public string DepartmentUponLogin = "";
    public string DistinguishedName = "";
    public string JobTitle = "";

    // for shadow
    protected bool shadow_mode = false;
    protected SystemUser shadow_user = null;   

	public PrivateLoginSession(SystemUser LoginUser, TypeOfDatabase DBType, string DBString) : base(LoginUser, DBType, DBString)
	{
		
	}

    public PrivateLoginSession(SystemUser LoginUser, SystemUser ShadowUser, TypeOfDatabase DBType, string DBString)
        : base(LoginUser, DBType, DBString)
    {
        this.shadow_mode = true;
        this.shadow_user = ShadowUser;
    }
}
